/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package tienda.zapateria.siszap.gui.control.model;

import java.util.List;
import org.rx.cr.gui.table.AbstractTableModel;
import tienda.zapateria.siszap.be.BERelacionTalla;
import tienda.zapateria.siszap.be.BETalla;

public class ModeloRelacionTalla extends AbstractTableModel<BETalla> {

    private final List<BETalla> List;

    public ModeloRelacionTalla() {
        setTitles(new String[]{"Tipo", "USA", "UE", "Stock"});
        this.List = null;
    }

    public ModeloRelacionTalla(List<BETalla> List) {
        setTitles(new String[]{"Tipo", "USA", "UE", "Stock"});
        this.List = null;
    }

    @Override
    public Object getObjectCell(int fila, int columna) {
        switch (columna) {
            case 0:
                return get(fila).getCategoria();
            case 1:
                return get(fila).getAmericana();
            case 2:
                return get(fila).getEuropea();
            case 3:
                return get(fila).getStock();
            default:
                return null;
        }

    }

//    @Override
//    public boolean isCellEditable(int rowIndex, int colIndex) {
//        return true;
//    }
//
//    @Override
//    public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
//        BETalla be = List.get(rowIndex);
//        if (0 == columnIndex) {
//            be.setCategoria(aValue.toString());
//        } else if (1 == columnIndex) {
//            be.setAmericana(aValue.toString());
//        } else if (2 == columnIndex) {
//            be.setEuropea(aValue.toString());
//        } else if (3 == columnIndex) {
//            be.setStock(Integer.parseInt(aValue.toString()));
//        }
//    }
//
//    @Override
//    public int getColumnCount() {
//        return 4;
//    }

}
